package com.situ.day15;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.util.Properties;

public class DBTest {
	public static void main(String[] args) throws IOException, ClassNotFoundException, NoSuchMethodException, SecurityException, InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
		FileInputStream fileInputStream = new FileInputStream("db.properties");
		Properties properties = new Properties();
		properties.load(fileInputStream);
		String className = properties.getProperty("className");
		System.out.println(className);
		Class clazz = Class.forName(className);
		Constructor constructor = clazz.getConstructor();
		AbstractDB db = (AbstractDB)constructor.newInstance();
		db.getConnection();
	}
}
